/**
 * Created by Administrator on 2017/3/21.
 */
import React, {Component} from 'react';
import {Form, Input,  Radio, Select,DatePicker,Button ,Icon,TreeSelect } from 'antd';
import {connect} from 'dva';
import moment from 'moment'
const TreeNode = TreeSelect.TreeNode;
const FormItem = Form.Item;
class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
      fileList: [],
    };
  }
  componentDidMount() {
  }
  render() {
    const formItemLayoutWithLabel = {
      labelCol: {
        xs: {span: 24},
        sm: {span: 9},
      },
      wrapperCol: {
        xs: {span: 24},
        sm: {span: 15},
      }
    };

    const {getFieldDecorator} = this.props.form;
    return (
      <div>
        <Form onSubmit={this.handleSubmit}>
          <FormItem label='开始时间'
                    {...formItemLayoutWithLabel}>
            {getFieldDecorator('start', {
              initialValue:moment(new Date().getFullYear()+'-'+(parseInt(new  Date().getMonth())+1)+'-'+'01' , "YYYY-MM-DD"),

            })(
              <DatePicker
                allowClear={false}
                format="YYYY-MM-DD"
              />
            )}
          </FormItem>
          <FormItem label='结束时间'
                    {...formItemLayoutWithLabel}>
            {getFieldDecorator('end', {
              initialValue: moment(),

            })(
              <DatePicker
                allowClear={false}
                format="YYYY-MM-DD"
              />
            )}
          </FormItem>
        </Form>
      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);
